package bean;

import java.io.Serializable;
import java.util.Date;

public class FundPriceHistoryPk implements Serializable {
	private Fund fund;
	private Date priceDate;
	
	public Fund getFund() {
		return fund;
	}

	public void setFund(Fund fund) {
		this.fund = fund;
	}
	
	public Date getPriceDate() {
		return priceDate;
	}
	
	public void setPriceDate(Date priceDate) {
		this.priceDate = priceDate;
	}
	
	@Override
	public boolean equals(Object o) {
		if (o instanceof FundPriceHistoryPk) {
			FundPriceHistoryPk pk = (FundPriceHistoryPk) o;
			return (pk.fund.getId() == (this.fund.getId())) && (pk.priceDate == this.priceDate);
		}
		
		return false;
	}
	
	@Override
	public int hashCode() {
		return ("" + this.fund.getName() + this.priceDate).hashCode();
	}


}
